<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="../Admin/role/css/index.css">
<script src="../Admin/role/js/jquery-1.7.1.min.js"></script>
</head>
<body class="mian_bj">
<div class="mian_top_01">
<div class="mian_top_r"></div>
<div class="mian_top_l"></div>
<div class="mian_top_c">

</div>
<div class="mian_b">
<div class="mian_b1">
<a class="mian_b1_a1" href="addUnitMessageLiu.action" title="添加"></a>
<a class="mian_b1_a2" a href="javascript:void(0)" onclick="del()" title="删除"></a>
<p class="mian_b1_sousuo"><input id="unumber" name="unumber" type="text" placeholder="请输入单元号" value=""></p>
<a onclick="selectLike()"  class="mian_b1_a3"></a>
<a href="#" title="最后" class="mian_b1_a4"></a>
<a href="#" title="下一页" class="mian_b1_a5"></a>
<p class="mian_b1_list">1 2 3 4……</p>
<a href="#" title="上一页" class="mian_b1_a6"></a>
<a href="#" title="最前" class="mian_b1_a7"></a>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="mian_b_bg">
<tr>
<td width="5%" class="mian_b_bg_lm"><input name="" type="checkbox" value="">&nbsp;</td>
<td width="11%" class="mian_b_bg_lm"><span></span>ID</td>
<td width="10%" class="mian_b_bg_lm"><span></span>单元号</td>
<td width="10%" class="mian_b_bg_lm"><span></span>房间数量</td>
<td width="25%" class="mian_b_bg_lm"><span></span>所属楼栋</td>
<td width="25%" class="mian_b_bg_lm"><span></span>所属项目</td>
<td width="20%" class="mian_b_bg_lm"><span></span>操作</td>
</tr>
<tr>
   <td>
    <c:forEach var="list" items="${units}">
    <tr>
						<td><input name=id type="checkbox" value="${list.id}">&nbsp;</td>
						<td>${list.id}</td>
						<td>${list.unumber}</td>
						<td>${list.housecount}</td>	
						<td>${list.cnumber}</td>
						<td>${list.projectname}</td>																
						<td width="8%" class="mian_b_icon_01"><a href="updateUnitMessageLiu.action?id=${list.id}">编辑</a></td>				
    </tr> 
	</c:forEach>
   </td>
<td>
</tr>
</table>
</div>
</div>
</body>
<script type="text/javascript"> 
	
	function del() {
		var id="";
		var value = document.body.querySelectorAll("input[type='checkbox']");
		for (var i = 0; i < value.length; i++) {
			if (value[i].checked) {
				var temp = value[i].value;
				if (temp != null) {
					id +=temp+",";
				}

			}
		}
		if (confirm("确定要删除吗")) {
			location.href = "deleteUnitById.action?id=" + id;
		}
	}
	function selectLike() {
     var unumber = document.getElementById("unumber").value; 
     location.href = "selectAllUnitLiu.action?unumber=" + unumber;
		
	}
		
</script>
</html>
